package com.my.dubbo.consumer;


import java.io.IOException;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.my.dubbo.consumer.annotation.ConsumerAnnotationService;
import com.my.dubbo.consumer.config.ConsumerConfiguration;
import com.my.dubbo.provider.DubboConfiguration;
import com.my.dubbo.provider.service.ProviderService;

/**
 * 注解方式启动
 *
 */
public class AppAnnotation {

	public static void main(String[] args) throws IOException {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConsumerConfiguration.class);
		context.start();
		ConsumerAnnotationService providerService = (ConsumerAnnotationService)context.getBean("consumerAnnotationService");
		System.out.println(providerService.sayHello("hello  dubbo, annotation"));
		System.in.read();
	}

}
